﻿using System;
using System.Diagnostics;
using System.Windows.Forms;

namespace TextEditor
{
   

    public class ZYTextExternal : ZYTextInput
    {
        public override bool HandleDblClick(int x, int y, MouseButtons Button)
        {
            if (this.Contains(x, y))
            {
                this.OpenLink();
                return true;
            }
            return false;
        }

        public virtual void OpenLink()
        {
            Process.Start(this.Link);
        }

        public string Key
        {
            get
            {
                return base.Attributes.GetString("key");
            }
            set
            {
                base.Attributes.SetValue("key", value);
            }
        }

        public string Link
        {
            get
            {
                return base.Attributes.GetString("link");
            }
            set
            {
                base.Attributes.SetValue("link", value);
            }
        }
    }
}

